package cn.modfun.web.core.model;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;

public class Mod implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -4583371723962320320L;

	public static class Controller extends HashMap<String,Object>{
		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;
		
		public Controller(){
			/* 默认设置为禁用 */
			this.put("status", "disable");
		}

		public String getString(String key){
			Object obj = this.get(key);
			if(obj!=null){
				return obj.toString();
			}
			return null;
		}
		
		public void setUri(String uri){
			this.put("uri", uri);
		}
		
		public void setViewPath(String viewPath){
			this.put("view_path", viewPath);
		}
		
		public void setClassName(String className){
			this.put("class_name", className);
		}
		
		public String getUri(){
			return this.getString("uri");
		}
		
		public String getViewPath(){
			return this.getString("view_path");
		}
		
		public String getStatus(){
			return this.getString("status");
		}
		
		public String getClassName(){
			return this.getString("class_name");
		}
		/**
		 * 设置状态
		 * disable 禁用 enable 启用
		 * @param status
		 */
		public void setStatus(String status){
			this.put("status", status);
		}
	}

	/**
	 * 组编号，相当于就是模块包的根
	 */
	private String group_id;
	
	private String name;
	
	private String author;
	
	private String version = "1.0.0";
	
	private String create_datetime;
	
	private List<Controller> controllers;
	
	private String status = "un-loaded";
	
	private String status_message = "未加载";
	/**
	 * 异常堆栈
	 */
	private String exception_stack_trace;
	
	public String getGroup_id() {
		return group_id;
	}

	public void setGroup_id(String group_id) {
		this.group_id = group_id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getCreate_datetime() {
		return create_datetime;
	}

	public void setCreate_datetime(String create_datetime) {
		this.create_datetime = create_datetime;
	}

	public List<Controller> getControllers() {
		return controllers;
	}

	public void setControllers(List<Controller> controllers) {
		this.controllers = controllers;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getStatus_message() {
		return status_message;
	}

	public void setStatus_message(String status_message) {
		this.status_message = status_message;
	}

	public String getException_stack_trace() {
		return exception_stack_trace;
	}

	public void setException_stack_trace(String exception_stack_trace) {
		this.exception_stack_trace = exception_stack_trace;
	}
	
}
